package com.bytz.modules.cms.order.model;

import com.bytz.modules.cms.order.entity.OrderItem;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;

public class ImmutableOrderItem {

    /**
     * value = "产品编码
     */
    public final String productNumber;

    /**
     * value = "产品数量
     */
    public final Integer productNum;

    /**
     * value = "不含税价
     */
    public final BigDecimal noTaxPrice;

    /**
     * value = "含税价
     */
    public final BigDecimal includeTaxPrice;

    /**
     * value = "协议价
     */
    public final BigDecimal negotiatePrice;

    /**
     * value = "优惠金额（使用优惠券平均抵扣）
     */
    public final BigDecimal deductionPrice;

    /**
     * value = "含税总价
     */
    public final BigDecimal totalTaxPrice;

    /**
     * value = "产品标准交期（取产品目录交期）
     */
    public final Integer deliveryDate;

    /**
     * 产品线Code
     */
    public final String productLineCode;

    /**
     * 毛利率
     */
    public final BigDecimal stfMargin;

    /**
     * 成本价
     */
    public final BigDecimal costPrice;

    /**
     * 构造不可变订单行
     *
     * @param orderItem
     */
    public ImmutableOrderItem(OrderItemModel orderItem) {
        productNumber = orderItem.getProductNumber();
        productNum = orderItem.getProductNum();
        noTaxPrice = orderItem.getNoTaxPrice();
        includeTaxPrice = orderItem.getIncludeTaxPrice();
        negotiatePrice = orderItem.getNegotiatePrice();
        deductionPrice = orderItem.getDeductionPrice();
        totalTaxPrice = orderItem.getTotalTaxPrice();
        deliveryDate = orderItem.getDeliveryDate();
        productLineCode = orderItem.getProductLineCode();
        stfMargin = orderItem.getStfMargin();
        costPrice = orderItem.getCostPrice();
    }
}